import { defHttp } from '/@/utils/http/axios';

import { MeetingList, SaveMeetingAction } from './model/meetingModel';

enum Api {
  GetMettingList = '/admin/meetingRoom/list',
  SaveMeetingRoom = '/admin/meetingRoom/save',
  GetMeetingRoomDetail = '/admin/meetingRoom/detail',
  DelMeetingRoom = '/admin/meetingRoom/delete',
}

// 获取会议室列表
export const getMeetingList = (params: MeetingList) =>
  defHttp.post<any>({ url: Api.GetMettingList, params });

// 新建/编辑会议室
export const editMeetingRoom = (params: SaveMeetingAction) =>
  defHttp.post<any>({ url: Api.SaveMeetingRoom, params });

// 获取会议室详情
export const getMeetingRoomDetails = (id: string | number) =>
  defHttp.post<any>({ url: Api.GetMeetingRoomDetail, params: { id } });

// 删除会议室
export const delMeetingRoom = (ids: string[] | number[]) =>
  defHttp.post<any>({ url: Api.DelMeetingRoom, params: { ids } });
